<template>
	<view class="pb100">
		<view class="topbox text-center pt30 pl30 pr30">
			<!-- 顶部占位盒子 -->
			<view class="topbg">
				<view class="header-bar"></view>
			</view>
			<!-- //顶部占位盒子 -->
			<!-- <text class="my">我的</text> -->
			<!-- 个人信息盒子 -->
			<view class="flex mt20">
				<!-- 左边头像盒子 -->
				<view class="avater">
					<image :src="userInfo.avatar" mode="aspectFill"></image>
				</view>
				<!-- //头像盒子 -->
				<!-- 右边盒子 -->
				<view class="flex row-column row-center ml30 avater-r col-top">
					<view class="nickname">{{userInfo.name}}</view>
					<view class="" @click="$jump('/subpkg/userInfo/userInfo')">
						<text class="mr10 infobox">个人信息</text>
						<u-icon name="arrow-right" color="#EDAEAE" size="20"></u-icon>
					</view>
				</view>
				<!-- //右边盒子 -->
			</view>
			<!-- //个人信息盒子 -->
			
			<!-- 订单盒子 -->
			<view class="orderbox mt30">
				<view class="flex row-between orderboxtit col-center">
					<view class="mt10">我的订单</view>
					<view class="" @click="$jump('/subpkg/myOrder/myOrder?current=0')">
						<text class="mr10">全部订单</text>
						<u-icon name="arrow-right" color="#DFDFDF" size="24"></u-icon>
					</view>
				</view>
				
				<!-- 我的订单宫格导航 -->
					<u-grid :col="5" :border='false'>
						<u-grid-item v-for="(item,i) in gridList" :key='i' @click="$jump(item.url)">
							<image :src="item.image" class="w80 h80"></image>
							<view class="grid-text fs24">{{item.title}}</view>
						</u-grid-item>
					</u-grid>
				<!-- 我的订单宫格导航 -->
			</view>
			<!-- //订单盒子 -->
			
			<!-- nav宫格导航 地址等-->
				<view class="mt10 orderbox">
					<u-grid :col="4" :border='false'>
						<u-grid-item v-for="(item,i) in infoList" :key='i' @click="$jump(item.url)">
							<image :src="item.image" class="w50 h50"></image>
							<view class="grid-text mt10 fs24">{{item.title}}</view>
						</u-grid-item>
					</u-grid>
				</view>
			<!-- nav宫格导航 -->
			
			<!-- 管理宫格导航 -->
				<view class="mt10 orderbox">
					<u-grid :col="4" :border='false'>
						<u-grid-item v-for="(item,i) in adminList" :key='i' @click="$jump(item.url)" >
							<image :src="item.image" class="w50 h50"></image>
							<view class="grid-text mt10 fs24">{{item.title}}</view>
						</u-grid-item>
					</u-grid>
				</view>
			<!-- 管理宫格导航 -->
			<!-- 在线客服盒子 -->
			<view class="flex row-center ">
				<view class="footerbyn mt50" @click="$jump('/subpkg/kefu/kefu?from=1')">在线客服</view>
			</view>
		</view>
		
	</view>
</template>

<script>
	export default {
		onShow() {
			this.getshop()
			this.userInfo=uni.getStorageSync('userinfo')
		},
		data() {
			return {
				//用户信息
				userInfo:'',
				gridList:[{
					image:'/static/image/my/daifukuan.png',
					title:'待付款',
					url:'/subpkg/myOrder/myOrder?current=1'
				},{
					image:'/static/image/my/daiqueren.png',
					title:'待确认',
					url:'/subpkg/myOrder/myOrder?current=2'
				},{
					image:'/static/image/my/bohui.png',
					title:'驳回',
					url:'/subpkg/myOrder/myOrder?current=6'
				},{
					image:'/static/image/my/daifahuo.png',
					title:'待发货',
					url:'/subpkg/myOrder/myOrder?current=3'
				},{
					image:'/static/image/my/daishouhuo.png',
					title:'待收货',
					url:'/subpkg/myOrder/myOrder?current=4'
				}],
				infoList:[{
					image:'/static/image/my/dingweiadd.png',
					title:'收货地址',
					url:'/subpkg/myAdd/myAdd'
				},{
					image:'/static/image/my/myshoucang.png',
					title:'我的收藏',
					url:'/subpkg/myCollection/myCollection'
				},{
					image:'/static/image/my/zuji.png',
					title:'我的足迹',
					url:'/subpkg/myTracks/myTracks'
				},{
					image:'/static/image/my/cart.png',
					title:'购物车',
					url:'/subpkg/cart/cart'
				}],
				//data==1显示
				adminList:[{
					image:'/static/image/my/friend.png',
					title:'朋友圈管理',
					url:'/subpkg/friendAdmin/friendAdmin',
				},{
					image:'/static/image/my/video.png',
					title:'视频管理',
					url:'/subpkg/videoAdmin/videoAdmin',
				}
				// ,{
				// 	image:'/static/image/my/dianpu.png',
				// 	title:'店铺管理',
				// 	url:'/subpkg/shopAdmin/shopAdmin',
				// 	data:0
				// }
				]
			};
		},
		methods:{
			getshop() {
				this.$api.getShop().then(res=>{
					console.log(res)
					// if(res.data.data==1) {
					// 	this.adminList[2].data=1
					// }
					uni.setStorageSync('shopDetail',res.data.shop)
				})
			},

		}
	}
</script>

<style lang="scss">
.my {
	font-size: 30rpx;
	color: #FFFFFF;
}
.topbg {
		background: #D23030;
	}
.topbox {
	width: 100%;
	height: 550rpx;
	background: url('~@/static/image/my/mybg.png') no-repeat;
	background-size: 100% 100%;
}
.avater {
	width: 130rpx;
	height: 130rpx;
	image {
		width: 100%;
		height: 100%;
		border-radius: 50%;
	}
}
.nickname {
	font-size: 40rpx;
	color: #FFFFFF;
}
.infobox {
	font-size: 24rpx;
	font-weight: 400;
	color: #EDAEAE;
}
.orderbox {
	// padding: 10rpx;
	padding-left: 10rpx;
	padding-right: 10rpx;
	// height: 236rpx;
	background: #FFFFFF;
	box-shadow: 0px 0px 10rpx 2rpx rgba(0,0,0,0.04);
	border-radius: 8rpx;
	.orderboxtit {
		view {
			font-size: 32rpx;
			color: #333333;
			text {
				font-size: 24rpx;
				color: #D0D0D0;
			}
		}
	}
}
.footerbyn {
	position: absolute;
	left: 50%;
	bottom: 80rpx;
	transform: translateX(-50%);
	width: 40%;
	height: 90rpx;
	background: #FFFFFF;
	border-radius: 16rpx;
	border: 2rpx solid #716F6F;
	text-align: center;
	line-height: 90rpx;
	font-size: 28rpx;
	color: #716F6F;
}
</style>
